from wcs.libs.items import items
from wcs.libs.players import players

itemName = "Socks of Feathers"
item = items.addItem(itemName)
item.setGroup("enhancement")
item.setCost(3000)
item.setDescription("lower your gravity")
item.aliveToUse = True
item.setMaxCount(1)

def wcs_item_bought(event_var):
    """
    Executed when a player has purchased an item. If the item purcahsed was this
    item, then ensure that we add to the player's gravity value.
    """
    if event_var['item'] == 'Socks of Feathers':
        userid = event_var['userid']
        player = players[userid]
        player.changeGravity(-0.35)